<!--
 * @Title: 几何三角形全等角边角证明
 * @Author: Math_teachaer_fan
 * @Date: 2025年7月24日
 * @Platform: HTML5/JavaScript
 * @Version: 1.0
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三角形全等SAS证明方法</title>
    <style>
        body {
            background-color: #008080; /* 蒂芙尼蓝 */
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            color: white;
        }
        
        .container {
            max-width: 1000px;
            margin: 0 auto;
            background-color: rgba(0, 0, 0, 0.3);
            padding: 20px;
            border-radius: 10px;
        }
        
        h1 {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 30px;
        }
        
        .proof-section {
            margin-bottom: 30px;
            padding: 20px;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
        }
        
        h2 {
            font-size: 1.8em;
            border-bottom: 2px solid white;
            padding-bottom: 10px;
        }
        
        .triangle-container {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            margin: 20px 0;
        }
        
        .triangle {
            position: relative;
            width: 300px;
            height: 250px;
            margin: 20px;
        }
        
        .triangle-labels {
            position: absolute;
            width: 100%;
            height: 100%;
        }
        
        .steps {
            counter-reset: step-counter;
            list-style: none;
            padding: 0;
        }
        
        .steps li {
            counter-increment: step-counter;
            margin-bottom: 15px;
            padding-left: 30px;
            position: relative;
        }
        
        .steps li:before {
            content: counter(step-counter);
            position: absolute;
            left: 0;
            top: 0;
            background-color: white;
            color: #008080;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            text-align: center;
            line-height: 20px;
            font-weight: bold;
        }
        
        .formula {
            font-style: italic;
            font-size: 1.2em;
            text-align: center;
            margin: 20px 0;
            padding: 10px;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 5px;
        }
        
        .conclusion {
            font-weight: bold;
            font-size: 1.3em;
            text-align: center;
            margin: 20px 0;
            padding: 15px;
            background-color: rgba(255, 255, 255, 0.3);
            border-radius: 5px;
        }
        
        .control-panel {
            text-align: center;
            margin: 20px 0;
            padding: 15px;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
        }
        
        .control-group {
            margin: 10px 0;
        }
        
        label {
            display: inline-block;
            width: 150px;
            text-align: right;
            margin-right: 10px;
        }
        
        input[type="range"] {
            width: 300px;
            vertical-align: middle;
        }
        
        .value-display {
            display: inline-block;
            width: 50px;
            text-align: left;
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>三角形全等的边角边(SAS)证明方法</h1>
        
        <div class="proof-section">
            <h2>SAS定理定义</h2>
            <p>边角边(Side-Angle-Side, SAS)定理指出：如果两个三角形的两组对应边相等，且这两组边的夹角也相等，则这两个三角形全等。</p>
            
            <div class="formula">
                若 AB = DE, AC = DF, 且 ∠A = ∠D，则 △ABC ≅ △DEF
            </div>
        </div>
        
        <div class="proof-section">
            <h2>动态演示</h2>
            <div class="control-panel">
                <div class="control-group">
                    <label for="side1">边长 AB = DE:</label>
                    <input type="range" id="side1" min="50" max="150" value="100">
                    <span class="value-display" id="side1-value">100</span>
                </div>
                <div class="control-group">
                    <label for="side2">边长 AC = DF:</label>
                    <input type="range" id="side2" min="50" max="150" value="90">
                    <span class="value-display" id="side2-value">90</span>
                </div>
                <div class="control-group">
                    <label for="angle">夹角 ∠A = ∠D:</label>
                    <input type="range" id="angle" min="30" max="150" value="60">
                    <span class="value-display" id="angle-value">60</span>°
                </div>
            </div>
            
            <div class="triangle-container">
                <div class="triangle">
                    <svg width="300" height="250">
                        <g id="triangle1">
                            <!-- 三角形ABC -->
                            <polygon points="50,200 150,200 100,100" fill="none" stroke="white" stroke-width="3"/>
                            
                            <!-- 边的标记 -->
                            <line x1="50" y1="200" x2="150" y2="200" stroke="yellow" stroke-width="4"/>
                            <line x1="50" y1="200" x2="100" y2="100" stroke="red" stroke-width="4"/>
                            
                            <!-- 角的标记 -->
                            <path d="M 70 190 A 20 20 0 0 1 85 180" fill="none" stroke="cyan" stroke-width="3"/>
                            
                            <!-- 顶点标签 -->
                            <text x="45" y="220" font-size="20" fill="white">A</text>
                            <text x="155" y="220" font-size="20" fill="white">B</text>
                            <text x="105" y="95" font-size="20" fill="white">C</text>
                            
                            <!-- 边长标签 -->
                            <text x="95" y="220" font-size="16" fill="yellow" id="ab-label1">100</text>
                            <text x="60" y="150" font-size="16" fill="red" id="ac-label1">90</text>
                            
                            <!-- 角度标签 -->
                            <text x="85" y="190" font-size="16" fill="cyan" id="angle-label1">60°</text>
                        </g>
                    </svg>
                    <div class="triangle-labels">
                        <p style="text-align: center; color: white; font-weight: bold;">△ABC</p>
                    </div>
                </div>
                
                <div class="triangle">
                    <svg width="300" height="250">
                        <g id="triangle2">
                            <!-- 三角形DEF -->
                            <polygon points="50,200 150,200 100,100" fill="none" stroke="white" stroke-width="3"/>
                            
                            <!-- 边的标记 -->
                            <line x1="50" y1="200" x2="150" y2="200" stroke="yellow" stroke-width="4"/>
                            <line x1="50" y1="200" x2="100" y2="100" stroke="red" stroke-width="4"/>
                            
                            <!-- 角的标记 -->
                            <path d="M 70 190 A 20 20 0 0 1 85 180" fill="none" stroke="cyan" stroke-width="3"/>
                            
                            <!-- 顶点标签 -->
                            <text x="45" y="220" font-size="20" fill="white">D</text>
                            <text x="155" y="220" font-size="20" fill="white">E</text>
                            <text x="105" y="95" font-size="20" fill="white">F</text>
                            
                            <!-- 边长标签 -->
                            <text x="95" y="220" font-size="16" fill="yellow" id="de-label2">100</text>
                            <text x="60" y="150" font-size="16" fill="red" id="df-label2">90</text>
                            
                            <!-- 角度标签 -->
                            <text x="85" y="190" font-size="16" fill="cyan" id="angle-label2">60°</text>
                        </g>
                    </svg>
                    <div class="triangle-labels">
                        <p style="text-align: center; color: white; font-weight: bold;">△DEF</p>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="proof-section">
            <h2>SAS证明步骤</h2>
            <ol class="steps">
                <li>给定两个三角形△ABC和△DEF</li>
                <li>已知条件：
                    <ul>
                        <li>边AB = 边DE (对应边相等)</li>
                        <li>边AC = 边DF (对应边相等)</li>
                        <li>∠A = ∠D (这两边的夹角相等)</li>
                    </ul>
                </li>
                <li>将△ABC叠放到△DEF上，使点A与点D重合，且边AB与边DE重合</li>
                <li>由于AB = DE，所以点B与点E重合</li>
                <li>由于∠A = ∠D，边AC与边DF重合</li>
                <li>由于AC = DF，所以点C与点F重合</li>
                <li>因为三个顶点都重合，所以两个三角形完全重合</li>
                <li>因此，△ABC ≅ △DEF (全等)</li>
            </ol>
        </div>
        
        <div class="proof-section">
            <h2>结论</h2>
            <div class="conclusion">
                根据边角边(SAS)定理，当两个三角形的两组对应边和它们的夹角分别相等时，这两个三角形全等。
            </div>
        </div>
    </div>

    <script>
        // 获取滑块元素
        const side1Slider = document.getElementById('side1');
        const side2Slider = document.getElementById('side2');
        const angleSlider = document.getElementById('angle');
        
        // 获取数值显示元素
        const side1Value = document.getElementById('side1-value');
        const side2Value = document.getElementById('side2-value');
        const angleValue = document.getElementById('angle-value');
        
        // 获取三角形元素
        const triangle1 = document.getElementById('triangle1');
        const triangle2 = document.getElementById('triangle2');
        
        // 获取标签元素
        const abLabel1 = document.getElementById('ab-label1');
        const acLabel1 = document.getElementById('ac-label1');
        const angleLabel1 = document.getElementById('angle-label1');
        const deLabel2 = document.getElementById('de-label2');
        const dfLabel2 = document.getElementById('df-label2');
        const angleLabel2 = document.getElementById('angle-label2');
        
        // 初始化显示值
        side1Value.textContent = side1Slider.value;
        side2Value.textContent = side2Slider.value;
        angleValue.textContent = angleSlider.value;
        
        // 添加事件监听器
        side1Slider.addEventListener('input', updateTriangles);
        side2Slider.addEventListener('input', updateTriangles);
        angleSlider.addEventListener('input', updateTriangles);
        
        // 更新三角形的函数
        function updateTriangles() {
            // 更新显示值
            side1Value.textContent = side1Slider.value;
            side2Value.textContent = side2Slider.value;
            angleValue.textContent = angleSlider.value;
            
            // 更新标签
            abLabel1.textContent = side1Slider.value;
            acLabel1.textContent = side2Slider.value;
            angleLabel1.textContent = angleSlider.value + '°';
            deLabel2.textContent = side1Slider.value;
            dfLabel2.textContent = side2Slider.value;
            angleLabel2.textContent = angleSlider.value + '°';
            
            // 计算三角形顶点坐标
            const baseX1 = 50;
            const baseY1 = 200;
            const baseX2 = baseX1 + parseInt(side1Slider.value);
            const baseY2 = baseY1;
            
            // 计算顶点坐标 (使用角度和边长)
            const angleRad = parseInt(angleSlider.value) * Math.PI / 180;
            const tipX = baseX1 + parseInt(side2Slider.value) * Math.cos(angleRad);
            const tipY = baseY1 - parseInt(side2Slider.value) * Math.sin(angleRad);
            
            // 更新三角形1
            const polygon1 = triangle1.querySelector('polygon');
            const line1_1 = triangle1.querySelector('line:nth-child(2)');
            const line1_2 = triangle1.querySelector('line:nth-child(3)');
            const arc1 = triangle1.querySelector('path');
            
            polygon1.setAttribute('points', `${baseX1},${baseY1} ${baseX2},${baseY2} ${tipX},${tipY}`);
            line1_1.setAttribute('x1', baseX1);
            line1_1.setAttribute('y1', baseY1);
            line1_1.setAttribute('x2', baseX2);
            line1_1.setAttribute('y2', baseY2);
            
            line1_2.setAttribute('x1', baseX1);
            line1_2.setAttribute('y1', baseY1);
            line1_2.setAttribute('x2', tipX);
            line1_2.setAttribute('y2', tipY);
            
            // 更新角标记
            const arcRadius = Math.min(25, parseInt(side1Slider.value)/4, parseInt(side2Slider.value)/4);
            const arcEndX = baseX1 + arcRadius * Math.cos(angleRad * 0.7);
            const arcEndY = baseY1 - arcRadius * Math.sin(angleRad * 0.7);
            arc1.setAttribute('d', `M ${baseX1 + arcRadius} ${baseY1} A ${arcRadius} ${arcRadius} 0 0 1 ${arcEndX} ${arcEndY}`);
            
            // 更新顶点标签位置
            triangle1.querySelector('text:nth-child(5)').setAttribute('x', baseX1 - 5);
            triangle1.querySelector('text:nth-child(5)').setAttribute('y', baseY1 + 20);
            triangle1.querySelector('text:nth-child(6)').setAttribute('x', baseX2 + 5);
            triangle1.querySelector('text:nth-child(6)').setAttribute('y', baseY2 + 20);
            triangle1.querySelector('text:nth-child(7)').setAttribute('x', tipX + 5);
            triangle1.querySelector('text:nth-child(7)').setAttribute('y', tipY - 5);
            
            // 更新边长标签位置
            abLabel1.setAttribute('x', (baseX1 + baseX2) / 2);
            abLabel1.setAttribute('y', baseY1 + 20);
            acLabel1.setAttribute('x', (baseX1 + tipX) / 2 - 20);
            acLabel1.setAttribute('y', (baseY1 + tipY) / 2);
            angleLabel1.setAttribute('x', baseX1 + 15);
            angleLabel1.setAttribute('y', baseY1 - 10);
            
            // 三角形2使用相同参数以显示全等关系
            const polygon2 = triangle2.querySelector('polygon');
            const line2_1 = triangle2.querySelector('line:nth-child(2)');
            const line2_2 = triangle2.querySelector('line:nth-child(3)');
            const arc2 = triangle2.querySelector('path');
            
            polygon2.setAttribute('points', `${baseX1},${baseY1} ${baseX2},${baseY2} ${tipX},${tipY}`);
            line2_1.setAttribute('x1', baseX1);
            line2_1.setAttribute('y1', baseY1);
            line2_1.setAttribute('x2', baseX2);
            line2_1.setAttribute('y2', baseY2);
            
            line2_2.setAttribute('x1', baseX1);
            line2_2.setAttribute('y1', baseY1);
            line2_2.setAttribute('x2', tipX);
            line2_2.setAttribute('y2', tipY);
            
            arc2.setAttribute('d', `M ${baseX1 + arcRadius} ${baseY1} A ${arcRadius} ${arcRadius} 0 0 1 ${arcEndX} ${arcEndY}`);
            
            // 更新三角形2的标签位置
            triangle2.querySelector('text:nth-child(5)').setAttribute('x', baseX1 - 5);
            triangle2.querySelector('text:nth-child(5)').setAttribute('y', baseY1 + 20);
            triangle2.querySelector('text:nth-child(6)').setAttribute('x', baseX2 + 5);
            triangle2.querySelector('text:nth-child(6)').setAttribute('y', baseY2 + 20);
            triangle2.querySelector('text:nth-child(7)').setAttribute('x', tipX + 5);
            triangle2.querySelector('text:nth-child(7)').setAttribute('y', tipY - 5);
            
            deLabel2.setAttribute('x', (baseX1 + baseX2) / 2);
            deLabel2.setAttribute('y', baseY1 + 20);
            dfLabel2.setAttribute('x', (baseX1 + tipX) / 2 - 20);
            dfLabel2.setAttribute('y', (baseY1 + tipY) / 2);
            angleLabel2.setAttribute('x', baseX1 + 15);
            angleLabel2.setAttribute('y', baseY1 - 10);
        }
        
        // 初始化三角形
        updateTriangles();
    </script>
</body>
</html>